from tppt.lib.actions.model.details import *

class ResultDetailsSection(Section):
	template='lib/details/result_details.html'
	
	def get_params(self):
		from tppt.data.models import ResultDetail
		result=self.entity
		details=ResultDetail.objects.filter(result=result)
		
		det_data=[]
		
		for detail in details:
			det_data.append({'caption': detail.detail_type.name,
							'value': detail.value})

		return {'details': det_data}
